<!--
	创建人：王永杰
	创建时间：2017年2月7日 11:59:16
	功能描述： 首页五图，广告图
-->
<div class="floor"></div>
<link type="text/css" rel="stylesheet" href="__TEMP__/{$style}/public/css/ns_style.css">
<!-- <link type="text/css" rel="stylesheet" href="https://test.dscmall.cn/themes/ecmoban_dsc2017/css/style.css"> -->
<div class="channel-content" ectype="channel">
        <div class="seckill-channel" id="h-seckill">
	<div class="box-hd clearfix">
		<i class="box-hd-icon"></i>
		<!-- <div class="sk-time-cd">
			<div class="sk-cd-tit">距结束</div>
			<div class="cd-time fl" ectype="time" data-time="2017-05-02 22:00:00">
				<div class="days hide">00</div>
				<span class="split hide">天</span>
				<div class="hours">04</div>
				<span class="split">时</span>
				<div class="minutes">30</div>
				<span class="split">分</span>
				<div class="seconds">25</div>
				<span class="split">秒</span>
			</div>
		</div> -->
        <div class="sk-more">
        	<a href="SHOP_MAIN/index/discount.html" target="_blank">更多秒杀<i class="arrow"></i></a>
        </div>
	</div>
	<div class="box-bd clearfix">
		<div class="tempWrap" style="overflow:hidden; position:relative; width:1220px">
		<ul>
		{volist name="discount_list" id="vo"}
				<li class="opacity_img clone" style="float: left; width: 232px;">
				<div class="p-img" style="position">
					<a href="SHOP_MAIN/goods/goodsinfo.html?goodsid={$vo.goods_id}" target="_blank">
						<img src="__UPLOAD__/{$vo['picture']['pic_cover_big']}" class="img-lazyload">
						<div class="brand-time" >
							<em class="time">
								<span class="settime" starttime="{$vo.start_time}" endtime="{$vo.end_time}" ></span>
							</em>
						</div>
					</a>
				</div>
				<div class="p-name"><a href="SHOP_MAIN/goods/goodsinfo.html?goodsid={$vo.goods_id}" target="_blank" title="{$vo.goods_name}">{$vo.goods_name}</a></div>
				<div class="p-over">
					<div class="p-info">
						<div class="p-price">
							<span class="shop-price"><em>¥</em>{$vo.promotion_price}</span>
							<span class="original-price"><em>¥</em>{$vo.price}</span>
						</div>
					</div>
					<div class="p-btn">
					<a href="SHOP_MAIN/goods/goodsinfo.html?goodsid={$vo.goods_id}" target="_blank">立即抢购</a>
				</div>
				</div>
			</li>
		{/volist}	
			</ul></div>
	</div>
</div>
</div>
<script >
$().ready(function() {
	updateEndTime();
});

//倒计时函数
function updateEndTime() {
	var date = new Date();
	var time = date.getTime(); //当前时间距1970年1月1日之间的毫秒数
	$(".settime").each(function(i) {
		var endDate = this.getAttribute("endTime"); //结束时间字符串
		//转换为时间日期类型
		var endDate1 = eval('new Date(' + endDate.replace(/\d+(?=-[^-]+$)/, function(a) {
			return parseInt(a, 10) - 1;
		}).match(/\d+/g) + ')');

		var endTime = endDate1.getTime(); //结束时间毫秒数
		var lag = (endTime - time) / 1000; //当前时间和结束时间之间的秒数
		if (lag > 0) {
			var second = Math.floor(lag % 60);
			var minite = Math.floor((lag / 60) % 60);
			var hour = Math.floor((lag / 3600) % 24);
			var day = Math.floor((lag / 3600) / 24);
			$(this).html("剩余" + day + "天" + hour + "时" + minite + "分" + second + "秒结束");
		} else{
			$(this).html("团购已经结束啦！");
		}
	});
	setTimeout("updateEndTime()", 1000);
}
</script>
